package org.smarthings.things.management.event;

import java.util.Dictionary;
import java.util.Hashtable;

import org.osgi.service.event.Event;

@SuppressWarnings({ "rawtypes", "unchecked" })
public class ThingEventBuilder {

	private String topic;
	private Dictionary properties = new Hashtable(5);

	public static ThingEventBuilder create() {
		return new ThingEventBuilder();
	}

	public ThingEventBuilder topic(String topic) {
		this.topic = topic;
		return this;
	}

	public ThingEventBuilder property(String key, Object value) {
		this.properties.put(key, value);
		return this;
	}

	public Event build() {
		return new Event(topic, properties);
	}

}
